<?php
/**
 * TomatoCMS
 * 
 * LICENSE
 *
 * This source file is subject to the GNU GENERAL PUBLIC LICENSE Version 2 
 * that is bundled with this package in the file LICENSE.txt.
 * It is also available through the world-wide-web at this URL:
 * http://www.gnu.org/licenses/gpl-2.0.txt
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to license@tomatocms.com so we can send you a copy immediately.
 * 
 * @copyright	Copyright (c) 2009-2010 TIG Corporation (http://www.tig.vn)
 * @license		http://www.gnu.org/licenses/gpl-2.0.txt GNU GENERAL PUBLIC LICENSE Version 2
 * @version 	$Id: Acl.php 5032 2010-08-28 17:29:35Z huuphuoc $
 * @since		2.0.0
 */

/**
 * Idea and most implementions here was taken from
 * http://www.phpclasses.org/browse/package/4100.html
 */
class Core_Services_Date extends Zend_Acl 
{
	public static function convert($str,$format="Y-m-d"){
		if(!empty($str)){
			$replace		= str_replace("/","-",$str);
			$date = date_create($replace);
			return date_format($date, 'Y-m-d');
		}else return NULL;		
	}
}
